home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Aug 90 / MacApp.Tech$ 8⁄3⁄90 / 1669-Re Page Setup & Dial-Jul90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  2.2 KB  |  72 lines  |  [TEXT/GEOL]

  1. Item    5381299                         30-July-90        15:56PDT
  2.  
  3. From:   D4684                           Robins Analytics, S Robins,PRT
  4.  
  5. To:     FARALLON.ENG                    Farallon, Engineering,PRT
  6.  
  7. cc:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Re: Page Setup & Dialog…
  10.  
  11. Eric,
  12.     I had to make my printing default to landscape also. There are two ways of
  13. doing it. At first I set the bit that is documented for imagewriters, but was
  14. assured by Keith Rollin that probably wasn't wise. He suggested the following
  15. code (or something similar, this is my implementation):
  16.  PROCEDURE TReportPrintHandler.SetToLandscape;
  17.  
  18.   VAR
  19.    dummy: boolean;
  20.    printRecordHandle: THPrint;
  21.  
  22.  BEGIN
  23.   printRecordHandle := THPrint(GetResource('prec', 1000));
  24.   FailResError;
  25.   THPrint(fHPrint)^^ := printRecordHandle^^;
  26.   ValidatePrintRecord(dummy);
  27.   CheckPrinter;
  28.   ReleaseResource(Handle(printRecordHandle));
  29.  END;
  30.  
  31. The 'prec' resource is one I created myself in a dummy program (I believe I
  32. used DemoDialogs or something like that, you will want to override a print
  33. handler). Run the program and choose the page setup you want as the default and
  34. in TPrintHandler.PosePageSetup… put some code in to write the print record
  35. handle to a resource after the dialog is closed. Then use resedit to paste it
  36. somewhere you can use it in your regular program.
  37.     As far as your second question goes. I have done a lot of things similar to
  38. what you mentioned. I would do it like this. Override the TDialogView that is
  39. the superview of the buttons and edit text. You don't need to override the
  40. buttons or edit text at all. In your TDialogView's DoChoice method do this:
  41.  
  42.  PROCEDURE TMyDialogView.DoChoice (origView: TView;
  43.        itsChoice: integer);
  44.   OVERRIDE;
  45.  
  46.    PROCEDURE ChangeTextEnable (enable: Boolean);
  47.  
  48.   BEGIN
  49.     Disable or enable the edit text's as needed here
  50.   END;
  51.  
  52.  BEGIN
  53.     CASE itsChoice OF
  54.     mRadioHit:
  55.         BEGIN
  56.             INHERITED DoChoice(origView, itsChoice);
  57.             ChangeTextEnable(origView.fIdentifier = kSecondButtonID);
  58.         END;
  59.     OTHERWISE
  60.         INHERITED DoChoice(origView,itsChoice);
  61.     END
  62. END;
  63.  
  64. Hope this helps,
  65.  
  66. Doug Ahmann
  67. Robins Analytics
  68. St. Paul, MN 55104
  69.  
  70.  
  71.  
  72.